//
//  SignListCell.m
//  Safflower
//
//  Created by 袁亮 on 2016/12/26.
//  Copyright © 2016年 Migic_Z. All rights reserved.
//

#import "SignListCell.h"

@interface SignListCell()

@property (nonatomic, strong) UIImageView *flower_image;

@end

@implementation SignListCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
//        self.contentView.backgroundColor = RGB(230, 230, 230);
        
        [self makeSignListCell];
    }
    return self;
}

- (void)makeSignListCell
{
    _sign_image_view = [UIImageView new];
    _sign_image_view.layer.masksToBounds = YES;
    _sign_image_view.layer.borderWidth = 0;
    _sign_image_view.contentMode = UIViewContentModeScaleAspectFill;
    [self.contentView addSubview:_sign_image_view];
    [_sign_image_view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(2);
        make.bottom.mas_equalTo(-2);
        make.left.mas_equalTo(2);
        make.right.mas_equalTo(-2);
    }];
    
    _flower_image = [UIImageView new];
    [self.contentView addSubview:_flower_image];
    [_flower_image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-5);
        make.left.mas_equalTo(5);
        make.size.mas_equalTo(CGSizeMake(16, 16));
    }];
}

- (void)loadSignData:(SignModel *)signModel
{
    [_sign_image_view sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",BaseIp,signModel.image]]];
    
    _flower_image.image = signModel.issign == YES ? [UIImage imageNamed:@"base_title_logo"] : nil;
}

@end
